const fs = require('fs')
const vendors = require('./chunk-vendors')

let arr = [
  'e82a', 'cc18', 'd0da', 'c16b',
  'f275', '4776', 'ec02', '818a',
  '4253', 'a124', 'e1d8', 'ea61',
  'e908', '488e', '96fb', '3856',
  '4fd9', 'a527', '0d6d', 'bab2',
  'b62f', '047d', '88a9', 'acb5',
  '07e1', '9ecf', '57cc', 'b10a',
  'c241', '0648', '478c', '52a9',
  '386e', '0d47'
]

let str = "module.exports = {"
arr.forEach((item) => {
  str += `"${item}":`
  str += vendors[item].toString()
  str += ","
})
str += "}"

// console.log('', str)

console.log('', __dirname)
console.log('', __filename)

fs.writeFile(__dirname + "/chunk-vvv.js", str, function (error) {
  if (error) {
    console.error("write error: " + error.message);
  } else {
    console.log("Successful Write to ");
  }
}); 